package org.example.model;

public class OrderDetail {
    private Integer detailId;
    private Integer orderId;
    private Integer productId;
    private Integer quantity;
    private Double unitPrice;
    
    // 可选：添加商品信息
    private String productName;
    private String productImage;
    
    // Getters and Setters
    public Integer getDetailId() {
        return detailId;
    }
    
    public void setDetailId(Integer detailId) {
        this.detailId = detailId;
    }
    
    public Integer getOrderId() {
        return orderId;
    }
    
    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }
    
    public Integer getProductId() {
        return productId;
    }
    
    public void setProductId(Integer productId) {
        this.productId = productId;
    }
    
    public Integer getQuantity() {
        return quantity;
    }
    
    public void setQuantity(Integer quantity) {
        this.quantity = quantity;
    }
    
    public Double getUnitPrice() {
        return unitPrice;
    }
    
    public void setUnitPrice(Double unitPrice) {
        this.unitPrice = unitPrice;
    }
    
    public String getProductName() {
        return productName;
    }
    
    public void setProductName(String productName) {
        this.productName = productName;
    }
    
    public String getProductImage() {
        return productImage;
    }
    
    public void setProductImage(String productImage) {
        this.productImage = productImage;
    }
    
    // 计算小计金额
    public Double getSubtotal() {
        return quantity * unitPrice;
    }
} 